﻿using System.ServiceModel.Channels;
using System.Xml;

namespace BookTheBook.Amazon
{
    internal class AmazonMessageHeader : MessageHeader
    {
        private readonly string _name;
        private readonly string _value;

        public AmazonMessageHeader(string name, string value)
        {
            _name = name;
            _value = value;
        }

        public override string Name
        {
            get { return _name; }
        }

        public override string Namespace
        {
            get { return "http://security.amazonaws.com/doc/2007-01-01/"; }
        }

        protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
        {
            writer.WriteString(_value);
        }
    }
}